

project(qbbridge)

set(QT_VERSION 5)
set(REQUIRED_LIBS Core Gui Widgets)
set(REQUIRED_LIBS_QUALIFIED Qt5::Core Qt5::Gui Qt5::Widgets pthread)

if(WIN32)
        find_package(Qt5 COMPONENTS Widgets WinExtras REQUIRED)
else()
        find_package(Qt${QT_VERSION} COMPONENTS ${REQUIRED_LIBS} REQUIRED)
endif()

file(GLOB_RECURSE  SRCS CONFIGURE_DEPENDS ./*.cpp)
source_group_by_dir(SRCS)

add_definitions(-DS_QB_DLL)
add_library(${PROJECT_NAME} SHARED
     ${SRCS}
	 res/qbbridge.qrc
	 )


if(WIN32)
    target_link_libraries(${PROJECT_NAME} PRIVATE Qt::Widgets Qt::WinExtras core guiframe bondlib uam)
elseif (LINUX)
    target_link_libraries(${PROJECT_NAME} ${REQUIRED_LIBS_QUALIFIED} core guiframe bondlib uam)
elseif (MACOS)
    target_link_libraries(${PROJECT_NAME} ${REQUIRED_LIBS_QUALIFIED} core guiframe bondlib uam)
endif()
